{% extends 'tablehead.html' %}
{% block body %}

<script>

{#<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>#}
<script type="text/javascript">


    $(document).on('click', '.confirm-delete', function(){
    return confirm('Are you sure you want to delete this?');
})

</script>

<div id="content">
    <div id="content-header">
        <div id="breadcrumb"><a href="/" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> Home</a> <a
                href="#" class="current">Projects List</a></div>

        <h1>Projects List</h1>
    </div>

    <div class="container-fluid">
        <div class="row-fluid">
            <div class="span12">
            <div class="widget-box">
                <div class="widget-title"><span class="icon"><i class="icon-th"></i></span>
                    <h5>Project List</h5>
                    <div class="buttons"><a data-toggle="modal" href="/projects/create_form/"
                                            class="btn btn-primary btn-mini"><i
                            class="icon-plus icon-white"></i> Add new Project</a>
                    </div>
                </div>
                <div class="widget-content nopadding">
                    <table class="table table-bordered data-table">
                        <thead>
                        <tr>
                            <!--<th>ID</th>-->
                            <th>Project</th>
                            <th>Date Time</th>
                            <th>Project Start Date</th>
                            <th>Project End Date</th>
                            <th>Project Owner</th>
                            <th>Project Status</th>
                            <th>Action</th>
                        </tr>
                        </thead>
                        <tbody>{% for data in all_projects %}
                        <tr data-target="#">
                            <td><a href="projects_view/?proj_id={{data.project_id}}">{{data.project_name}}</a></td>
                            <td>{{data.date_time}}</td>
                            <td>{{data.project_start}}</td>
                            <td>{{data.project_end}}</td>
                            <td>{{data.project_owner}}</td>
                            <td>{{data.project_status}}</td>
                            <td class="confirm-delete">
                                <form action="/projects/" method="POST">
                                    <input type="hidden" name="proj_id" value="{{data.project_id}}"/>{% csrf_token %}
                                    <button class="btn btn-danger"><i class="icon-remove"></i></button>
                                </form>
                            </td>
                        </tr>
                        {% endfor %}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        </div>
    </div>
</div>

{% endblock %}